﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OblivionLevelingHelper.Attributes
{
    public class AttributeSet
    {
        private readonly Character _parent;
        private readonly Dictionary<AttributeTypes, Attribute> _attributes;

        public AttributeSet(Character parent)
        {
            // Set the parent Character
            _parent = parent;

            // Configure all skills
            _attributes = new Dictionary<AttributeTypes, Attribute>();
            foreach (AttributeTypes attribute in Enum.GetValues(typeof(AttributeTypes)))
            {
                Add(attribute);
            }
        }

        public void Add(AttributeTypes attributeType)
        {
            _attributes.Add(attributeType, new Attribute(attributeType, _parent));
        }

        public Attribute GetAttribute(AttributeTypes attributeType)
        {
            return _attributes[attributeType];
        }

        public List<Attribute> GetAttributes()
        {
            return _attributes.Values.ToList();
        }
    }
}
